package com.sfh.alliance.beauty;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;

import com.sfh.alliance.R;
import com.sfh.base.mvp.IPresenter;
import com.sfh.base.ui.UIMVPActivity;
import com.sfh.entity.Beauty;
import com.squareup.picasso.Picasso;

import java.io.File;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 功能描述详情界面
 *
 * @date 2017/9/2
 */
public class BeautyInfoActivity extends UIMVPActivity {


    @BindView(R.id.iv_photo)
    ImageView ivPhoto;

    @BindView(R.id.tv_jy)
    TextView tvJy;

    @BindView(R.id.tv_ml)
    TextView tvMl;

    @BindView(R.id.tv_love)
    TextView tvLove;

    @BindView(R.id.tv_child)
    TextView tvChild;

    @BindView(R.id.iv_colse)
    ImageView ivColse;

    Beauty beauty;

    @BindView(R.id.iv_name)
    ImageView ivName;

    public static void startContentUI(Context context, Beauty beauty) {

        Intent intent = new Intent (context, BeautyInfoActivity.class);
        intent.putExtra ("DATA", beauty);
        context.startActivity (intent);

    }


    @Override
    public IPresenter createPresenter() {


        return null;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {

        super.onCreate (savedInstanceState);
        setContentView (R.layout.beauty_info_activity);
        ButterKnife.bind (this);
        init ();
    }

    private void init() {

        beauty = getIntent ().getParcelableExtra ("DATA");

        Picasso.with (this)
                .load (new File ("android_asset/"+beauty.getBeauty ().getName ())).config (Bitmap.Config.RGB_565)
                .into (ivName);
        Picasso.with (this)
                .load (new File ("android_asset/" + beauty.getBeauty ().getRole ())).config (Bitmap.Config.RGB_565)
                .into (ivPhoto);
    }


}
